﻿using log4net.Layout;

namespace MiniFox.Log
{
    /// <summary>
    /// 
    /// </summary>
    public class LogPatternLayout : PatternLayout
    {
        /// <summary>
        /// 
        /// </summary>
        public LogPatternLayout()
        {
            this.AddConverter("property", typeof(LogPatternConverter));
        }
    }

    ///// <summary>
    ///// 
    ///// </summary>
    //public class DatabaseAppender : log4net.Appender.AdoNetAppender
    //{
    //    /// <summary>
    //    /// 
    //    /// </summary>
    //    /// <param name="connectionType"></param>
    //    /// <param name="connectionString"></param>
    //    /// <returns></returns>
    //    protected override IDbConnection CreateConnection(Type connectionType, string connectionString)
    //    {
    //        if (!typeof(IDbConnection).IsAssignableFrom(connectionType))
    //            throw new InvalidOperationException();
    //        IDbConnection instance = Activator.CreateInstance(connectionType, connectionString) as IDbConnection;
    //        instance.ConnectionString = ConfigurationManager.ConnectionStrings[connectionString].ConnectionString;
    //        return instance;
    //    }
    //}

}
